// js/script.js
// 动态粒子效果
function createStarfield() {
    const container = document.querySelector('.stars');
    for(let i = 0; i < 200; i++) {
        const star = document.createElement('div');
        star.className = 'star-particle';
        star.style.left = `${Math.random() * 100}%`;
        star.style.top = `${Math.random() * 100}%`;
        star.style.animationDelay = `${Math.random() * 5}s`;
        container.appendChild(star);
    }
}

// 卡片悬停效果
document.querySelectorAll('.glass-card').forEach(card => {
    card.addEventListener('mousemove', (e) => {
        const rect = card.getBoundingClientRect();
        const x = e.clientX - rect.left;
        const y = e.clientY - rect.top;
        
        card.style.transform = `
            perspective(1000px)
            rotateX(${(y - rect.height/2) / 20}deg)
            rotateY(${-(x - rect.width/2) / 20}deg)
        `;
    });

    card.addEventListener('mouseleave', () => {
        card.style.transform = 'none';
    });
});

// 初始化
document.addEventListener('DOMContentLoaded', () => {
    createStarfield();
    
    // 标题动画
    const title = document.querySelector('.glowing-title');
    title.style.animation = 'titleGlow 2s ease-in-out infinite';
});